using System;
using System.Collections.Generic;
using System.Text;

namespace FrameworkX.ObjectSpace.Data.Schema
{
    public class DecimalAttribute : DataTypeAttribute
    {
        public DecimalAttribute(int precision, int scale) : base (System.Data.DbType.Decimal, 0,precision,scale, true, null, false, false)
        {
        }

        public DecimalAttribute(int precision, int scale,bool isNullable)
            : base(System.Data.DbType.Decimal, 0, precision , scale, isNullable, null, false, false)
        {
        }

        public DecimalAttribute(int precision, int scale, bool isNullable, string defaultValue)
            : base(System.Data.DbType.Decimal, 0, precision, scale, isNullable, null, false, false)
        {
            if (defaultValue!=null)
            {
                if (!defaultValue.Equals(string.Empty))
                {
                    this.DefaultValue = decimal.Parse(defaultValue);
                }
            }
        }
    }
}
